<template>
  <div v-loading="loading">
    <template>
      <el-table
        :data="dataList"
        style="width: 100%"
      >
        <el-table-column
          prop="tableName"
          label="物理表名称"
          min-width="200"
        />
      </el-table>
    </template>
  </div>
</template>

<script>
    import { listWordOnlineKeyQuoteTable } from '@/api/system/word/wordOnlineKeyQuoteTable'
    export default {
        data() {
            return {
                // 表单参数
                form: {},
                // 遮罩层
                loading: false,
                // 表单校验
                rules: {
                },
                queryParams: {
                    keyId: undefined
                },
                dataList: []
            }
        },
        created() {
        },
        methods: {
            // 初始化数据
            init(data) {
                this.loading = true
                if (data != null && data.id !== undefined) {
                  this.queryParams.keyId = data.id
                  listWordOnlineKeyQuoteTable(this.queryParams).then(response => {
                        this.dataList = response.rows
                        this.loading = false
                    }).catch(() => {
                      this.loading = false
                    })
                } else {
                    this.reset()
                    this.loading = false
                }
            },
            // 表单重置
            reset() {
                this.form = {
                    id: undefined,
                    keyId: undefined,
                    tableName: undefined,
                    createBy: undefined,
                    updateBy: undefined,
                    createTime: undefined,
                    updateTime: undefined,
                    delFlag: undefined
                }
                this.resetForm('form')
            },
            // 取消按钮
            cancel() {
                this.$parent.$parent.formOpen = false
                this.$parent.$parent.reset()
            },
            // 关闭form页面
            closeForm() {
                // 关闭form页面遮罩层
                this.loading = false
                // 关闭form页面
                if (this.$parent.$parent.formOpen !== undefined) {
                  this.$parent.$parent.formOpen = false
                }
                // 刷新list页面
                if (this.$parent.$parent.getList !== undefined) {
                  this.$parent.$parent.getList()
                }
            }
        }
    }
</script>
